<?php
class lib_database
{
	public static $database_type;
	public static $database_obj;	
	
	public static function init()
	{
		$current_class = __CLASS__;
		if(self::$database_obj instanceof $current_class)
		{
			return self::$database_obj;
		}
		else
		{
			$xmlObj = lib_xml::init();
			self::$database_type = $xmlObj->getConfig('data/type');
			if(self::$database_type == 'mysql')//mysql数据库
			{
				$_mysql_ = lib_mysql::init();
				self::$database_obj = $_mysql_;
				return $_mysql_;
			}
			elseif(self::$database_type == 'mssql')//microsoft sqlserver数据库
			{
				
			}
		}
	}
	
	private function __construct()
	{
		
	}
}
?>